package fhp.hlhj.giantfold.module

import com.lzy.okgo.model.HttpParams
import fhp.hlhj.giantfold.javaBean.ChangeInfoBean
import fhp.hlhj.giantfold.network.UrlApis

/**
 * author: FHP
 * data: on 2018\1\19 0019 11:01
 * E-Mail: 103945089@qq.com
 */
class ChangeUserInfoModule {
    interface ChangeInfoListener{
        fun showLoading()
        fun onChangeListener(changeInfoBean: ChangeInfoBean)
    }

    fun changeInfo(params: HttpParams,listener: ChangeInfoListener){
        UrlApis.changeUserInfo(params)
                .doOnSubscribe {
                    listener.showLoading()
                }
                .subscribe { data->
                    listener.onChangeListener(data)
                }

    }
}